﻿$(document).ready(function () {
    //CKEDITOR.replace('E_Content');

    //    $("#Form1").validate({
    //        rules: { txtSoftName: "required", txtSoftSize: "required", E_Content: "required" },
    //        messages: { txtSoftName: " 必填项", txtSoftSize: " 必填项", E_Content: " 必填项" }
    //    });
 
    $("#btnSoftAdd_Click").click(function () {
        if ($("#ddlCategoryId").val() < 1) {
            alert("请选择栏目！");
            $("#ddlCategoryId").focus();
            return false;
        }
    });
});
function GetImage() {
    $("#dialog-modal").dialog({
        height: 540,
        width: 540,
        title: "图片浏览",
        modal: true
    });
    var urlC = $("#dialog-modal-url");
    urlC.attr("src", "../window/GetImage.aspx");
    urlC.width(500);
    urlC.height(500);
}
function GetTemplate() {
    $("#dialog-modal").dialog({
        height: 450,
        width: 500,
        title: "网页模板",
        modal: true
    });
    var urlC = $("#dialog-modal-url");
    urlC.attr("src", "../window/GetTemplate.aspx?Control=txtTemplateFileName");
    urlC.width(460);
    urlC.height(410);
}
function GetTag() {
    $("#dialog-modal").dialog({
        height: 450,
        width: 500,
        title: "Tags选用",
        modal: true
    });
    var urlC = $("#dialog-modal-url");
    urlC.attr("src", "../window/GetTag.aspx?ModelId=" + Request.QueryString("ModelId") + "&Control=txtKey");
    urlC.width(460);
    urlC.height(410);
}
function AuthorMore() {
    var urlC = $("#dialog-modal-url");
    urlC.attr("src", "../window/GetContentProperty.aspx?ModelId=" + Request.QueryString("ModelId") + "&Type=3&Control=txtAuthor");
    urlC.width(460);
    urlC.height(410);

    $("#dialog-modal").dialog({
        height: 450,
        width: 500,
        title: "作者选用",
        modal: true
    });
}

function EmailMore() {
    var urlC = $("#dialog-modal-url");
    urlC.attr("src", "../window/GetContentProperty.aspx?ModelId=" + Request.QueryString("ModelId") + "&Type=4&Control=txtEmail");
    urlC.width(460);
    urlC.height(410);

    $("#dialog-modal").dialog({
        height: 450,
        width: 500,
        title: "电子邮件",
        modal: true
    });
}

function DecompressPasswordMore() {
    var urlC = $("#dialog-modal-url");
    urlC.attr("src", "../window/GetContentProperty.aspx?ModelId=" + Request.QueryString("ModelId") + "&Type=5&Control=txtDecompressPassword");
    urlC.width(460);
    urlC.height(410);

    $("#dialog-modal").dialog({
        height: 450,
        width: 500,
        title: "解压密码",
        modal: true
    });
}

function ColorPalette() {
    var str = window.showModalDialog("../Images/JS拾色器/JS拾色器.htm", "dialogWidth=190px;dialogHeight=80px");
    if (typeof (str) != "undefined") {
        $get('txtColorStyle').value = str;
        LoadStyle();

    }
}
function LoadStyle() {
    if ($get('txtColorStyle') == null) {
        return;
    }
    var str = $get('txtColorStyle').value;
    if (str == "") {
        $get('imgColorStyle').style.backgroundColor = "#000000";
    }
    else {
        $get('imgColorStyle').style.backgroundColor = str;
    }
}
function ToSize(size) {
    $get("txtSoftSize").value = $get("txtSoftSize").value + size;
    $get("txtSoftSize").focus();
    return false;
}